import org.apache.hadoop.io.WritableComparable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class date_FlowBean implements WritableComparable<date_FlowBean> {
    private long require_nums;
    private long end_date;
    private String jd_title;

    public String getJd_title() {
        return jd_title;
    }

    public void setJd_title(String jd_title) {
        this.jd_title = jd_title;
    }

    public date_FlowBean() {
        super();
    }



    @Override
    public int compareTo(date_FlowBean bean) {
        int result;
        if (end_date > bean.getEnd_date()) {
            result = -1;
        } else if (end_date  < bean.getEnd_date()) {
            result = 1;
        } else {
            result = 0;
        }
        return result;
    }

    @Override
    public void write(DataOutput out) throws IOException {
        out.writeLong(require_nums);
        out.writeLong(end_date);
    }

    @Override
    public void readFields(DataInput in) throws IOException {
        require_nums = in.readLong();
        end_date = in.readLong();
    }

    public long getEnd_date() {
        return end_date;
    }

    public void setEnd_date(long end_date) {
        this.end_date = end_date;
    }

    public long getRequire_nums() {
        return require_nums;
    }

    public void setRequire_nums(long require_nums) {
        this.require_nums = require_nums;
    }

    @Override
    public String toString() {
        return require_nums + "\t" + end_date ;
    }

    public void setjd_title(String jd_title) {
    }
}